<?php

if(isset($_GET['excel']))
{
	$fname = $_GET['excel'];
	$taille=filesize("temp/".$fname); 
	header("Content-Type: application/force-download; name=\"$fname\" "); 
	header("Content-Length: $taille"); 
	header("Content-Disposition: attachment; filename=\"$fname\" "); 
	header("Pragma: no-cache");
	header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public");
	header("Expires: 0");
	readfile("temp/".$fname);
}
else
{
	$fname = $_GET['name'];
	$furl =  $_GET['url'];
	$fmime = $_GET['mime'];

	while(@ob_end_clean());
	header("Content-disposition: attachment; filename=$fname");
	header("Content-Type: application/force-download");
	header("content-type: ".$fmime);
	header("Content-Length: ".filesize($furl));
	header("Pragma: no-cache");
	header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public");
	header("Expires: 0");
	readfile($furl);
}
?>